namespace SimpleWebServices.Web.Routing
{
    using System.Web;
    using System.Web.Routing;
    using Moq;
    using SimpleWebServices;
    using SimpleWebServices.Web.Mvc;
    using Xunit;

    public sealed class GenericRouteHandlerFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(new ObjectExpectations<GenericRouteHandler<NotFoundController>>()
                .DerivesFrom<object>()
                .IsConcreteClass()
                .IsSealed()
                .HasDefaultConstructor()
                .Implements<IRouteHandler>()
                .Result);
        }

        [Fact]
        public void ctor()
        {
            Assert.NotNull(new GenericRouteHandler<NotFoundController>());
        }

        [Fact]
        public void op_GetHttpHandler_RequestContextNull()
        {
            RequestContext request = new RequestContext(new Mock<HttpContextBase>().Object, new RouteData());

            Assert.NotNull(new GenericRouteHandler<NotFoundController>().GetHttpHandler(request));
        }
    }
}